----------------------------------

 


43. _______________ isthe java API for RESTfulweb services.?  
A. JAX-RS  
B. JAX-WS  
R
C. Both of the above  
D. None of the above  
44. Select programming languagessupported by Web Services  
a. c++  
b. Java  
c. Python  
d. C  
e. All of the above  
R
45.Which two statementsare true about the Web services? (any 2)  
a. SOAP messages are compressed during transport to reduce size of payload. R-C E  
b. You have to implement session tracking via HTTPcookies.  
c. The WSDL defines services as collections of network endpoints.  
d. All data shared between Java and non-Java components must be in XML format.  
e. Data interchange is done via in XML.  
46.We have a Web Service that can respond with a Street name when receiving a House number.  
This service will be used on several mobile devices and size of payload should be small to consume  
less bandwidth. Which technologies can provide the best solution for this requirement? (any 3)  
a. XML R-BDE  
b. JSON  
c. JAX-WS  
d. JAX-RS  
e. HTTP  
47.Given a following code snippet of the service canyou tell what is the name of the operation in  
WSDL file?  
@
WebService(serviceName = "PayrollSystemService", name = "PayrollSystem", portName =  
"
PayrollSystemPort")  
public class PayrollSystem {  
public String getEmployeeDetails(Long empId){  
return ""dummyDetails"";  
}
}
a. getEmployeeDetails  
R
b. getEmployeeDetailsOperation  
c. getEmployeeDetailsMethod  
d. getEmployeeDetailsWebMethod  
e. getEmployeeDetailsService  
48. What is JAXB?  
a.Java API for XML Bean  
b.Java API for XML Binding  
c.Java API for XML Basics  
R
49.Response entity is defined in which package?  
a.javax.ws.rs.core.Response R  
b.javax.ws.rs.Response  
c.javax.ws.Response  
50.Which is the discovery protocol?  
a.SOAP  
b.HTTP  
c.UDDI  
d.WSDL  
R
1.Our company wants to create JAX-WS Web service client for weather forcast service. This weather  
forcast service is implemented in C++. You have given a WSDL file for service. What is correct  
statement to be able to create WS client from WSDL.  
a. Use JAXP to parse and generate the java classes from WSDL. Then create Service Endpoint  
Interface(SEI)from factoryclasses. Then use SEI to callWS.  
b. Use wsgen to generate SEI from WSDL and then invoke SEI's methods to call WS.  
c. Use wsimport to generate SEI from WSDL and then invoke SEI's methods to call WS.  
d. We can not consume a web service createdin C++ on java.  
R
2.What is an best way of the handling of application exceptions thrown by a JAX-WS service  
endpoint?  
a. Exceptions should be mapped to faults in WSDL. R  
b. Exceptions are NOT handled by JAX-WS clients.  
c. Exceptions are always propagatedto JAX-WS clients as RemoteExceptions.  
d. Exceptions are alwayspropagatedto JAX-WS clients as WebServiceExceptions.  
e. Exceptions are always propagatedto JAX-WS clients as SOAPFaultExceptions.  
3.What is the correct definition of WSDL's port element?  
a. Contains data type definitions using type system.  
b. Description of an action supported by the service.  
c. Set of operations supported by one or more Endpoints.  
d. A single endpoint defined as a combination of a binding and a network address. R  
4.Which two statementsare true about the Web services? (any 2)  
a. SOAP messages are compressed during transport to reduce size of payload. R-C D  
b. You have to implement session tracking via HTTPcookies.  
c. The WSDL defines services as collections of network endpoints.  
d. Data interchange is done via XML.  
5
.We want to develop a Web Service and after developing we understood result processing cantake  
a long time to finish. So we decided to convert it to asynchronous method invocations. Is it possible  
to convert our synchronous Web Service to an asynchronous Web Service using SOAP?  
a. True R  
b.False  
6
.Which of the following code snippet matches to this WSDL portType element?  
portType name="ElementsTableImpl">  
<
<operation name="getTable">  
<input message="tns:getTable"/>  
<output message="tns:getTableResponse" />  
<fault message="tns:WsException" name="WsException" />  
</operation>  
</portType>  
a.@WebService  
public class ElementsTableImpl{  
public SimpleElementsTable getElementsTable(Integer number)throws WsException {  
SimpleElementsTable table = new SimpleElementsTable(number);  
return table;  
}
}
b.@WebService  
public class ElementsTableImpl{  
public SimpleElementsTable getTable(Integer number){  
SimpleElementsTable table = new SimpleElementsTable(number);  
returntable;  
}
}
c.@WebService (endpointInterface="ElementsTableService")  
public class ElementsTableImpl{  
public SimpleElementsTable getTable(Integer number)throws WsException {  
SimpleElementsTable table = new SimpleElementsTable(number);  
returntable;  
}
}
d.@WebService  
R
public class ElementsTableImpl{  
public SimpleElementsTable getTable(Integer number)throws WsException {  
SimpleElementsTable table = new SimpleElementsTable(number);  
returntable;  
}
}
7.Select HTTPmethods associate with SOAP Web service.  
a. Put  
b. Post  
c. Get  
R
d. Delete  
8.Select the operations supported by Web Services.  
a. One way (Request only)  
b. Two way(Request - Response)  
c. Solicit-Response (Server push message and client responds)  
d. Notification (Request/message from server to client)  
e. All of the above  
R
9.Select statementswhich are true for SOAP. (any 3)  
R-A B C  
a. SOAP is specification for exchanging structured information  
b. SOAP relies on other transport protocols like http, ftp for data trasmission  
c. SOAP uses xml to format data  
d. SOAP uses json to format data  
10.There are two approaches to develop a web service, depending on whether you define the  
contract first or last.  
a) True R  
b) False  
11.Incontrast, the contract-first approach encouragesyou to think of the service contract first in  
terms of :-  
a.XML  
b.XML Schema(.xsd)  
c.WSDL  
d.All of the mentioned  
R
12.Tosend objects across the wire, beans need to be encoded using the Java Architecture for XML  
Binding (JAXB).  
a.True R  
b.False  
13. Ifyou are deploying into a Java EE 5 (or better)container, you may simply create a bean that is  
annotatedwith:-  
a. javax.jws.WebService  
b. javax.jws.WebServiceProvider  
c. a&b  
R
d. none of these  
14.Tomcat doesn’t support JAX-WS by itself.  
a.True  
R
b. False  
15. Which of the following role of web service architecture implements the service and makes it  
available on the Internet?  
a. Service Provider  
b. Service Requestor  
c. Service Registry  
d. None of the above  
R
16.The simpler approach of implementing a web service is named as  
a. Entity State Transfer  
b. JavaScript EntityNotation  
c. Representation State Transfer  
d. JavaScript Object Notation  
R
17.Coding and decoding, and transporting the data is performed by  
a. XML and UDDI  
b. XML and SOAP  
c. HTML and HTTP  
d. HTML and SOAP  
R
18.Web Services are  
a.Loosely Coupled  
b.TightlyCoupled  
R
c.Either Loosely or Tightly Coupled  
d.Neither Loosely nor TightlyCoupled  
19.Which of the following is true about Web services?  
a.Webservices are open standard (XML, SOAP, HTTPetc.)based Web applications.  
b.Web services interact withother web applications for the purpose of exchanging data.  
c.Web Services can convert your existing applications into Web-applications.  
d.All of the above.  
R
20.Which of the following is correct statement about Synchronicity?  
a.Synchronicity refers to the binding of the client to the execution of the service.  
b.Insynchronous invocations, the client blocks and waits for the service to complete its operation  
before continuing.  
c.Asynchronous operations allow a client to invoke a service and then execute other functions.  
d.All of the above  
R
21.How request is sent in XML-RPC?  
a.Requestsare encoded in XML and sent via HTTPPOST.  
b.Requests are encoded in XML and sent via HTTPGET.  
c.Bothof the above.  
R
d.None of the above.  
22.Which of the following is a security issue with web services?  
a.Confidentiality  
b.Authentication  
c.NetworkSecurity  
d.All of the above R  
23.URL means ________.  
a.Address of the resource on the web R  
b.Termused to describe Website  
c.Termused to get online program  
d.None of these  
24. Rest is stateful.  
a.True  
b.False R  
25.What is the full form of JSON?  
a.JavaScript Object Native  
b.JavaScript Object Notation  
c.JavaScript Object Negation  
d.Java Object Notation  
R
26. The Service requestor provides a central place where developers can publish new services or find  
existing ones.  
a.True  
b.False R  
27. Which of the following is correctlydefining loosely coupled architecture of web service?  
a. A consumer of a web service is not tied to that web service directly.  
b. The web service interface can change over time without compromising the client's ability to  
interact with the service.  
c.Adopting a loosely coupled architecture tends to make software systems more manageable and  
allows simpler integrationbetween different systems.  
d. All of the above. R  
28. Which of the following is correct about UDDI?  
a. UDDI is an XML-based standard for describing, publishing, and finding web services.  
b.UDDI is a specification for a distributed registry of web services.  
c.UDDI isplatform independent, open framework.  
d. All of the above. R  
29.Which of the following is true about behavioral characteristicsof web services?  
a. Asynchronous clients retrieve their result at a later point in time, while synchronous clients  
receive their result when the service has completed.  
b. A web service supports RPC by providing services of its own, equivalent to those of a traditional  
component, or by translating incoming invocations into an invocation of an EJB or a .NET  
component.  
c.Web services support the transparent exchange of documents to facilitate business integration.  
d.All of the above.  
R
30.Which of the following is correct about XML Messaging layer in Web Service Protocol Stack?  
a.This layer is responsible for encoding messages in a common XML format so that messages can be  
understood at either end.  
b.Currently, this layer includes XML-RPC and SOAP.  
c.Bothof the above.  
d.None of the above.  
R
1
1
2
3
4
.Which of following statements is/are False?  
. XML overcomes the limitations in HTML to support a structured way of organizing content.  
. XML specification is not case sensitive while HTML specification is case sensitive.  
. XML supports user defined tags while HTML uses pre-defined tags.  
. XML tags need not be closed while HTML tags must be closed.  
a.2 only  
b.1 only  
c.2 and 4  
d.3 and 4  
ans:c  
2
.Consider an XML file called intro.xml and a document type defintion (DTD) file intro.dtd as  
follows:  
intro.xml  
<
<
<
<
<
?xml version = "1.0"?>  
!DOCTYPE myMessage SYSTEM "intro.dtd"›  
myMessage>  
message>Welcome to XML</message>  
/myMessage>  
intro.dtd  
<
<
! ELEMENT myMessage (message)>  
! ELEMENT message (#PCDATA)>  
A validating parser will classify intro.xml as  
a.Well-formed and validated  
b.Well-formed but not validated  
c.Validated but not well-formed  
ans:a  
3
.Given below is an excerpt of an xml specification.  
<
<
<
<
<
<
<
<
<
Book>  
title> GATE 2005 </title>  
type value = "BROCHURE"/>  
accno>10237623786</accno>  
/Book>  
Book>  
type value = "FICTION"/>  
accno>0024154807</accno>  
/Book>  
Given below are several possible excerpts from "library.dtd". For which excerpt would the  
above specification be valid?  
a.<!ELEMENT Book (title+, type, accno)>  
<
<
!ELEMENT title (#PCDATA)>  
!ELEMENT type EMPTY>  
<
!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
b.  
<
<
!ELEMENT Book (title?, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value  
(
BROCHURE/FICTION/TECHNICAL)> <!ATTLIST accno value (#PCDATA)>  
c.  
<
<
!ELEMENT Book (title*, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value  
(
BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
d.  
<
<
!ELEMENT Book (title?, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value  
(
BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
ans:d  
4
.Which of the following is TRUE only of XML but NOT HTML?  
a.It is derived from SGML  
b.It describes content and layout  
c.It allows user defined tags  
d.It is restricted only to be used with web browser  
ans:a,c  
5
.Which of the following statements are true with reference to the way of describing XML  
data?  
(
a)XML uses DTD to describe the data  
b)XML uses XSL to describe the data (c)  
(
XML uses a description node to describe the data Codes:  
a.(a) only  
b.(b) only  
c.(a) and (b)  
d.(a) and (c)  
ans:d  
6.In XML we can specify the frequency of an element by using the symbols:  
a.+ * !  
b.# * !  
c.+* ?  
d.-*?  
ans:c  
7
.The definitions in an XML document are said to be __________ when the tagging system and  
definitions in the DTD are all in compliance.  
a.well-formed  
b.reasonable  
c.valid  
ans:c  
8
.The behaviour of the document elements in XML can be defined by  
a.Using document object  
b.Registering appropriate event handlers  
c.Using element object  
d.All of the above  
ans:d  
9
. Which is a valid XML comment?  
a.<!– It is comment — section –>  
b.<!– It is comment section –>  
c.<!– It is comment section>  
d.<!– It is comment section –!>  
ans:b  
1
0.An XML element can contain  
a.text  
b.attributes  
c.other elements  
d. mix of the above  
ans:d  
1.In XML, you can indicate an empty element like this:  
1
a.<element></element>  
b.<element/>  
c.a and b  
d.none  
ans:c  
1
2.XML namespaces avoid element naming conflict.  
a.True b.False  
ans:a  
1
3.What is true about XML Schema?  
a. It is used to describe and validate the structure and the content of XML data.  
b. XML schema defines the elements, attributes and data types.  
c. It is similar to a database schema that describes the data in a database.  
d. All of the above  
ans:d  
1
4.How an element can be defined within an XSD?  
a. <xs:element name = "x" type = "y"/>  
b. <?xs:element name = "x" type = "y"/>  
c. <xs:element name = "x" type = "y">  
d. </xs:element name = "x" type = "y"/>  
ans:a  
1
5._______ element is used only in the context of the text.  
a. Complex Type  
b. Simple type  
c. Global Types  
d. All of the above  
ans:d  
16.Which of the following are correct predefined simple types?  
a. xs:integer  
b. xs:char  
c. xs:float  
d. xs:bool  
ans:a  
1
7.Attributes have _______ property.  
a. name  
b. type  
c. Both A and B  
d. None of the above  
ans:c  
18.Simple type Built into Schema "data" represent a date in?  
a. MM-DD-YY  
b. DD-MM-YYYY  
c. YY-MM-DD  
d. YYYY-MM-DD  
ans:d  
19. XML uses the features of  
a.HTML  
b.XHTML  
c.VML  
d.SGML  
ans:d  
2
0.What are the parsers supported in XML?  
a.non validating and validating  
b.well documented  
c.well formed  
d.none of the above  
ans:a  
2
1.Which of the following strings is a correct XML name?  
a._myElement  
b.my Element  
c.#myElement  
d.None of the above  
ans:a  
2
2.Which of the following are well formed XML fragments?  
a.< myElement myAttribute="someValue’/>  
b.< myElement myAttribute=someValue/>  
c.< myElement myAttribute=’someValue’>  
d.< myElement myAttribute="someValue"/>  
ans:d  
23.Any XML must have:-  
a.Closing tag  
b.Root element  
c.Nested child  
d.both a and b  
ans:d  
2
4.How to specify the attributes with multiple values?  
a.< myElement myAttribute="value1" myAttribute="value2"/>  
b.< myElement myAttribute="value1 value2"/>  
c.attributes cannot have multiple values  
d.< myElement myAttribute="value1, value2"/>  
ans:c  
2
5.In terms of performance, which of the following parsers are more suitable?  
a.DOM  
b.SAX  
ans:b  
2
6.Is it easier to process XML than HTML?  
a.No  
b.Yes  
c.Sometimes  
d.Can’t say  
ans:b  
2
7. In XML, what is identified by a URI reference?  
a.XML namespace  
b.XSLT  
c.Schema  
d.DLT  
ans:a  
2
8. An element is declared as ANY in the DTD as  
<
!ELEMENT BODY ANY>. Which are all valid element declaration?  
a.<BODY> sometext</BODY>  
b.<BODY>  
<
<
<
elements>  
elements>  
/BODY>  
c.<BODY>  
sometext  
<
<
<
elements>  
elements>  
/BODY>  
d.All are valid  
ans:d  
2
9.An element is declared as  
!ELEMENT test ( sample +, conclusion )> in DTD. Which element is valid in XML document?  
a.<test>  
<
<
<
<
<
sample>……..</sample>  
sample>……..</sample>  
conclusion>…</conclusion>  
/test>  
b.<test>  
<
<
conclusion>…</conclusion>  
/test>  
c.<test>  
<
<
<
sample>……..</sample>  
conclusion>…</conclusion>  
/test>  
d.<test>  
<
<
<
conclusion>…</conclusion>  
sample>……..</sample>  
/test>  
ans:a,c  
3
0.What is the meaning of this declaration in DTD?  
<
<
!ELEMENT Student ( name, age)>  
!ATTLIST Student no CDATA #REQUIRED >  
a.Student element should have two attributes name and age  
b.Student element should not have any CDATA  
c.Student element should have an attribute no  
d.Student element should have name and age as child elements,attribute no is mandatory  
ans:d  
3
1. Which of the following statements are true?  
a.DOM is event based and SAX is object based  
b.DOM is object based and SAX is event based  
c.Both are object based  
d.Both are event based  
ans:b  
3
2. Which of the following statemetns are true?  
1
.org.w3c.dom defines Document class (a DOM) as well as classes for all the components of  
a DOM  
2
.org.xml.sax defines the basic SAX APIs.  
3
.javax.xml.parsers is the JAXP APIs, which provide a common interface for different  
vendors' SAX and DOM parsers.  
a.1 and 2  
b.2 and 3  
c.1 and 3  
d. All are true  
ans:d  
3
3. State which of the following statements are true.  
1
.A resource class is a Java class that uses JAX-RS annotations to implement a  
corresponding Web resource.  
2.Resource classes are POJOs that have at least one method annotated with @Path or a  
request method designator.  
a. 1 is true and 2 is false  
b. 2 is true and 1 is false  
c. Both are true  
d. Both are false  
ans:c  
34.Which annotation is used to extract the value of a URI template parameter?  
a.@QueryParam  
b.@FormParam  
c.@PathParam  
d.@HeaderParam  
ans:c  
3
5.Only public methods may be exposed as resource methods.State True/False.  
a.True b. False  
ans:a  
3
6.Conversion between an entity body and a Java type is the responsibility of  
a.Entity  
b.EntityProvider  
c.Resource class  
d.None  
ans:b  
3
7.State whether the following statements are true/false.  
1
.The MessageBodyReader interface defines the contract between the JAX-RS runtime and  
components that provide mapping services from representations to a corresponding Java  
type.  
2.The MessageBodyWriter interface defines the contract between the JAX-RS runtime and  
components that provide mapping services from a Java type to a representation.  
a.1 only  
b.2 only  
c.1 and 2 are true  
d.1 and 2 are false  
ans:c  
38.What is the status code returned by the server for bad request?  
a.400  
b.401  
c.403  
d.404  
ans:a  
3
9.What is XSRF/CSRF?  
a.Cross Site Response Forgery  
b.Cross Site Request Forgery  
c.Cross Site Rest Forgery  
ans:b  
4
0.Entities can have hyperlinks.  
a. True b.False  
ans:a  
4
1.The URI template for a resource method is given as follows:  
http://example.com/{name1}/{name2}/. What are the valid requests that can be send from  
client?  
a.http://example.com/jay/gatsby/  
b.http://example.com/jay/  
c.http://example.com/*  
ans:a  
4
2.Which of the following are valid URI templates?  
a.http://example.com/{question}/{question}/{question}/  
b.http://example.com/maps/{location}  
c.http://example.com/{name3}/home/  
d.All are valid  
e.None of the above are valid  
ans:d  
4
3.Which of the following is valid JSON declaration to represent a user with attributes  
id,name and profession?  
a.{  
"
"
"
id":1,  
name":"Mahesh",  
profession":"Teacher"  
}
b.[  
"
"
"
id":1,  
name":"Mahesh",  
profession":"Teacher"  
]
c.{  
id:1,  
name:"Mahesh",  
profession:"Teacher"  
}
d.{  
"
"
"
id":"1",  
name":"Mahesh",  
profession":"Teacher"  
}
ans:a  
4
4.SOAP is not tied to any specific transport protocol.  
a. True b.False  
ans:a  
4
5.XML-RPC  
is the simplest XML-based protocol for exchanging information between  
computers.  
a.True b. False  
ans:a  
4
6.You are going to develop Stock market web service which will be consumed by other  
companies. Java team from your company want to re-use your web service code as soon as  
possible. Which approach you will follow in this case?  
A. Top down (contract first)  
B. Meet in the middle  
C. Bottom up (code first)  
D. None of the above  
ans:c  
4
7.Our company want to create application in which servlet will be exposed as WS endpoint.  
What we will require among following? (any 3)  
A. Application needs to be packaged as JAR file.  
B. Application needs to be packaged as WAR file.  
C. web.xml is required.  
D. webservice.xml is required.  
E. WEB-INF directory is required.  
F. META-INF directory is required.  
ans:b,c,e  
4
8.Please select incorrect statement among following statements.  
a.Confidentiality - encrypting of SOAP messages  
b.Integrity - signing of SOAP messages  
c. Authentication - attach security tokens to SOAP messages  
d. Non-repudiation - signing of SOAP messages  
e. Authorization - attach identity tokens to SOAP message  
ans:e  
4
9.What are three benefits of using SSL to connect to a Web service ? (any 3)  
a. The server is assured of the client's identity if the client issues the certificate.  
b. The client is assured of the server's identity.  
c. Message integrity is preserved between the client and the server.  
d. The communication between the client and the server is still logged.  
e. The communication between the client and the server is encrypted.  
f. Using SSL over HTTP incurs less overhead than HTTPS.  
ans:a,c,e  
5
0.Which of the following methods are not Idempotent?  
a.Get  
b.Post  
c.Put  
d.Delete  
ans:b  
5
1.Which of these are not the elements WSDL ?  
a.Types  
b.Port Type  
c.Service  
d.destination  
ans:d  
5
2. Which of these test do use an HTTP POST and will send the XML response.  
a.<?xml version="1.0" encoding="utf-8" ?>  
short xmlns="http://tempuri.org/">38</short>  
b.<?xml ?>  
short xmlns="http://tempuri.org/">38</short>  
c.<?xml version="1.0" encoding="utf-8" ?>  
short xmlns="http://tempuri.org/">38  
<
<
<
d.<short xmlns="http://tempuri.org/">38</short>  
ans:a  
5
3.The Web services can not offer the application components like:  
a.currency conversion  
b.weather reports  
c.language translation  
d.web browsers  
ans:d  
5
4.The XML provides the ________ in which you can write the specialized languages to  
express the complex interactions between the clients and the services or between the  
components of a composite service.  
a.language  
b.metalanguage  
c.meta  
d.services  
ans:b  
55.Schema is an _____ based alternative for DTD.  
a.XHTML  
b.XSLT  
c.XSL  
d.XML  
ans:d  
5
6.XSLT is:  
a.Extensible Stylesheet Language Translators  
b.Extended Stylesheet Language Transformation  
c.Extensible Stylesheet Language Transformation  
d.Extensible Style Language Transformation  
ans:c  
5
7.What is a web service?  
a.A standard way of integrating web-based applications  
b.One type of service that can be part of a Service Oriented Architecture  
c.Programmable XML-based service  
d.All of the above  
ans:d  
5
8. Service Transport, XML Messaging, Service Description and Service Discovery are four  
layers of  
a.web service implementing client components  
b.web service protocol stack  
c.web service supporting repository  
d.web service supporting request and response components  
ans:b  
5
9.Web Services attempts to describe architecture based on  
a.Representational State Transfer (REST)  
b.Remote Procedure Calls  
c.Reusable Application Components  
d.None of the above  
ans:a  
60.Which of the following is an open source SOAP server and client?  
a.Apache ANT  
b.Apache Tomcat  
c.Jakarta Struts  
d.Apache Axis  
ans:b  
1
.Which are the main features of XML?  
a. Text data description  
b. Human- and computer-friendly format  
c. Handles data in a tree structure having one-and only one-root element  
d. All mentioned above  
ans:d  
2
.Which is a language for finding information in an XML document?  
a. Xpath  
b. XSLT  
c. XLink  
d. XPointer  
ans:a  
3
.Find the correct syntax of the declaration which defines the XML Version?  
a. < ?xml version= "1.0" ? >  
b. < xml version="1.0"/ >  
c. < ?xml version="1.0" / >  
d. None of the above  
ans:a  
4
.An XML DOM parser converts an XML document into an XML DOM object, which can then be  
manipulated with JavaScript.  
a.True b.False  
ans:a  
5
. Abbreviate the term DOM?  
a. Developed Object Model  
b. Document Object Model  
c. Document Oriented Model  
ans:b  
6
.Which language is case sensitive?  
a. HTML  
b. XML  
c. Both A & B  
d. None of the above  
ans:b  
7
.Which parser is read only?  
a.DOM  
b.SAX  
c.Both  
d.None  
ans:b  
8
.The getElementsByTagName() method is used to retrieve data from an XML document.  
a. True  
b. False  
ans:a  
9
<
<
<
<
. The following example shows which XML Syntax rule,  
note date=" 12/11/2007">  
to>Tove< /to>  
from>Jani< /from>  
/note>  
a. XML Attribute Values Must be Quoted  
b. All XML Elements Must Have a Closing Tag  
c. XML Tags are Case Sensitive  
d. XML Elements Must be Properly Nested  
ans:all the above  
1
0. XML is ?  
a. Platform Independent  
b. Language Independent  
c. Both A & B  
d. None of the above  
ans:c  
1
1. Which are the techniques for defining the structure of a specific type of XML documents?  
a. Schema  
b. DTD  
c. Both A & B  
d. None of the above  
ans:c  
1
2.Which is not a XML function?  
a. Transport information  
b. Style information  
c. Store information  
d. Structure information  
ans:b  
1
<
<
<
<
<
3. Is this a 'well formed' XML document?  
?xml version="1.0"? >  
note >  
to age="29" >John< /to >  
from >Smiley< / from >  
/ note >  
a. True  
b. False  
ans:a  
1
4.Which character in the XML Element will generate an error because the parser interprets it as the  
start of a new element?  
a. " < "  
b. "&"  
c. Both A & B  
d. None of the above  
ans:a  
1
5. Which is not a W3C-recommended specification?  
a. SAX  
b. DOM  
c. Both A & B  
d. None of the above  
ans:a  
1
6. Which internet language is used for describing available web services in XML?  
a. WSDL  
b. RSS  
c. RDF  
d. OWL  
ans:a  
1
7.XML is the most common tool for data transmissions between all sorts of applications  
a. True  
b. False  
ans:a  
1
8. Which is a software- and hardware-independent tool for carrying information?  
a. HTML  
b. XML  
c. Both A & B  
d. None of the above  
ans:b  
1
9.Which Characters are illegal in XML elements?  
a. " < "  
b. "&"  
c. Both A & B  
d. None of the above  
ans:c  
2
0. What is XML used to simplify?  
a. Data storage  
b. Data sharing  
c. Both A & B  
d. None of the above  
ans:c  
2
1.Which are the XML Syntax rules?  
a. All XML Elements Must Have a Closing Tag  
b. XML Tags are not Case Sensitive  
c. XML Elements Must be Properly Nested  
d. Both A & C  
ans:d  
2
2. XML documents must contain a root element; this element is "the parent" of all other elements  
a. True  
b. False  
ans:a  
2
3.XML is designed to store data and _____.  
a. Design  
b. Verify  
c. Transport  
d. Both A & B  
ans: c  
2
4.XML attribute values must always be enclosed in quotes  
a. True  
b. False  
ans:a  
2
5.XML is designed to carry data, and to display data  
a. True  
b. False  
ans:b  
2
6.In XML document comments are given as?  
a. < !-- -->  
b. < !-- ?  
c. < /-- -->  
d. < ?-- ?  
ans:a  
2
7.Which of the following is true about SAX parsing?  
a. SAX parser reads an XML document from top to bottom, recognizing the tokens that make up a  
well-formed XML document.  
b. SAX parser reports the application program the nature of tokens that the parser has encountered  
as they occur  
c. The application program provides an 'event' handler that must be registered with the parser.  
d.All of the above.  
ans:d  
2
8.Which of the following method get called when element ends in SAX parsing?  
a. startDocument()  
b.endDocument()  
c.startElement()  
d. endElement()  
ans:d  
2
9. Which method of JDOM Parser gets the root element of the XML?  
a. Element.getRootElement()  
b. Document.getRootElement()  
c. Node.getRootElement()  
d.Node.getChild(Name)  
ans:b  
3
0.Which technology provides the flexibility to swap between XML processors with no application  
code changes?  
a. JAAS  
b. SAX  
c. XSLT  
d. JAXP  
ans:d  
1
.How to declare element with minimum one occurrence?  
a.<! ELEMENT element-name(element-content+)>  
b.<! ELEMENT element-name(element-content+)!>  
c.<! ELEMENT element-name(element-content)!>  
d.None of the listed options  
ans:a  
2
.Which of the following XML statement is valid?  
a.<message> if price<60</message>  
b.<message> if price lt 60 </message>  
c.<message> if price &lt; 60</message>  
d.None of the listed options  
ans:c  
3
.DTD stands for  
a.Document Type Definition  
b.Direct Type Definition  
c.Dynamic Type Definition  
d.None of these  
ans:a  
4
.Which of the following correctly defines use of DTD in XML development?  
a.DTD are used by parsers for validating the structure of the XML  
b.DTD are used as contract between two systems to interoperate.  
c.An Application can use the DTD to validate the XML structure it has received from external systems  
d.All the above  
ans:d  
5
.Any text that should not be parsed by the xml parser needs to declare as:  
I: PCDATA  
II: CDATA  
a.I  
b.II  
c.Both I and II  
d. None of the above  
ans:b  
6
.What is an XML instance  
a.An XML Document  
b.An XML element  
c.An XML attribute  
ans:a  
7
1
2
3
.What are the uses of XML parsers?  
.Parsing XML files and retrieving data from XML elements  
.Creating XML files programmatically  
.Used to direct conversion using an XSLT processor  
a.1&2  
b.2  
c.1&3  
d.2&3  
ans:a  
8
.Which parser reads small chunk of document at a time,parses it, generate an events and then  
reads another chunk of document?  
a.DOM  
b.SAX  
c.Both  
d.none  
ans:b  
9
.Which defines standard set of objects for creating XML's?  
a.SAX  
b.XML DOM  
c.XML  
d.SAX DOM  
ans:b  
1
0.Which type of parser is suitable,when applications is required to read data without modifying the  
content?  
a.DOM  
b.SAX  
c.Both  
d.None  
ans:b  
1
1.Which statement creates DocumentBuilder instance?  
a.DocumentBuilder b=new DocumentBuilder();  
b.DocumentBuilder b=new Builder();  
c.DocumentBuilder b=factory.new DocumentBuilder();  
d.None  
ans:c  
1
2.What does XSL stands for?  
a.Extensive Style sheet language  
b.Extensible Style Language  
c.Extensible Style Sheet Language  
d.None  
ans:c  
1
3.Which statement creates DocumentBuilderFactory instance?  
a.DocumentBuilderFactory f=new DocumentBuilderFactory();  
b.DocumentBuilderFactory f= BuilderFactory.newInstance();  
c.DocumentBuilderFactory f=DocumentBuilderFactory.newInstance();  
ans:c  
1
4.Which language is used for formatting XML documents?  
a.XSL  
b.XSLT  
c.XSL-FO  
ans:c  
1
5.Which is used to transform XML document?  
a.Xpath  
b.XSLT  
c.XML  
d.XSL  
ans:b  
1
1
2
3
6.What are the two common exceptions in JAXP?  
.ParserConfigurationException  
.FactoryConfigurationException  
.FactoryConfigurationError  
a.1&2  
b.3  
c.1&3  
d.1  
ans:c  
1
7.JAXP Stands for  
a.Java API eXtensive processing  
b.Java API eXtensible Processing  
c.Java API for XML Processing  
d.Java API for XML Parsing  
ans:c  
1
8.In which package JAXP related API's are available?  
a.javax.xml.parsers.*;  
b.javax.xml.*;  
c.javax.parsers.xml.*;  
ans:a  
1
9.Which complex type specifies that the elements should always be in the order specified?  
a.<xs:complexType name="CountrInfo">  
<xs:all>  
<xs:element name="countryName" type="xs:string"/>  
<xs:element name="states" type="xs:integer"/></xs:all>  
</xs:complexType>  
b.<xs:complexType name="CountrInfo"><xs:choice> <xs:element name="countryName"  
type="xs:string"/>  
<
xs:element name="states" type="xs:integer"/></xs:choice>  
/xs:complexType>  
c.<xs:complexType name="CountrInfo">  
<
<xs:sequence> <xs:element name="countryName" type="xs:string"/>  
<xs:element name="states" type="xs:integer"/>  
</xs:sequence></xs:complexType>  
ans:c  
2
0.Which statement specifies a constant value for a simple element?  
a.<xs:element name="CountryName" type="xs:string" constant="India"/>  
b.<xs:element name="CountryName" type="xs:string" fixed="India"/>  
c.<xs:element name="CountryName" type="xs:string" fixedvalue="India"/>  
ans:b  
2
1.Which complex type signifies that only one of the child elements can appear?  
a.<xs:complexType name="CountrInfo">  
<xs:all>  
<xs:element name="countryName" type="xs:string"/> <xs:element name="states"  
type="xs:integer"/></xs:all>  
/xs:complexType>  
b.<xs:complexType name="CountrInfo">  
<
<
<
<
<
xs:choice>  
xs:element name="countryName" type="xs:string"/>  
xs:element name="states" type="xs:integer"/>  
/xs:choice></xs:complexType>  
c.<xs:complexType name="CountrInfo">  
<
xs:sequence> <xs:element name="countryName" type="xs:string"/>  
xs:element name="states" type="xs:integer"/></xs:sequence></xs:complexType>  
ans:b  
<
2
2.Which method of DocumentBuilder is used to parse the xml file?  
a.parse  
b.read  
c.parseXML  
ans:a  
2
3.In XML DOM every XML element is treated as Node.  
a.True b.False  
ans:a  
2
4.Which method is used to get the element type of a XML document?  
a.node.getNodeType()  
b.node.getElementType()  
c.node.getType()  
ans:a  
2
5.Which statement is true?  
a.All XML elements must be lower case  
b.All XML documents must have a DTD  
c.All XML elements must be properly closed  
d.All the statements are true  
ans:c  
2
6.Which statement is NOT true?  
a.White-space is not preserved in XML  
b.XML documents must have a root tag  
c.XML tags are case sensitive  
d.XML elements must be properly nested  
ans:a  
2
7.XML elements cannot be empty  
a.False b.True  
ans:a  
2
8.Which is not a correct name for an XML element?  
a.<1dollar>  
b.<h1>  
c.<Note>  
d.All 3 names are incorrect  
ans:a  
2
8.For the XML parser to ignore a certain section of your XML document, which syntax is correct?  
a.![CDATA[ Text to be ignored ]]>  
b.<CDATA> Text to be ignored </CDATA>  
c.<xml:CDATA[ Text to be ignored ]>  
d.<PCDATA> Text to be ignored </PCDATA>  
ans:a  
2
9.What are XML entities used for?  
a.Entities define shortcuts to standard text or special characters bEntities define shortcuts to  
standard elements  
c.Entities define shortcuts to standard attributes  
ans:a  
3
0. Which XML DOM object represents a node in the node tree?  
a.The node object  
b.The nodeList object  
c.The document object  
ans:a  
1
1
2
3
4
.Which of following statements is/are False?  
. XML overcomes the limitations in HTML to support a structured way of organizing content.  
. XML specification is not case sensitive while HTML specification is case sensitive.  
. XML supports user defined tags while HTML uses pre-defined tags.  
. XML tags need not be closed while HTML tags must be closed.  
a.2 only  
b.1 only  
c.2 and 4  
d.3 and 4  
ans:c  
2
.Consider an XML file called intro.xml and a document type defintion (DTD) file intro.dtd as follows:  
intro.xml  
<
<
<
<
<
?xml version = "1.0"?>  
!DOCTYPE myMessage SYSTEM "intro.dtd"›  
myMessage>  
message>Welcome to XML</message>  
/myMessage>  
intro.dtd  
<
! ELEMENT myMessage (message)>  
! ELEMENT message (#PCDATA)>  
<
A validating parser will classify intro.xml as  
a.Well-formed and validated  
b.Well-formed but not validated  
c.Validated but not well-formed  
ans:a  
3
.Given below is an excerpt of an xml specification.  
Book>  
<
<
<
<
<
<
<
<
<
title> GATE 2005 </title>  
type value = "BROCHURE"/>  
accno>10237623786</accno>  
/Book>  
Book>  
type value = "FICTION"/>  
accno>0024154807</accno>  
/Book>  
Given below are several possible excerpts from "library.dtd". For which excerpt would the above  
specification be valid?  
a.<!ELEMENT Book (title+, type, accno)>  
<
!ELEMENT title (#PCDATA)>  
!ELEMENT type EMPTY>  
<
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
b.  
<
!ELEMENT Book (title?, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value  
<
(BROCHURE/FICTION/TECHNICAL)> <!ATTLIST accno value (#PCDATA)>  
c.  
<
!ELEMENT Book (title*, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value  
<
(BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
d.  
<
!ELEMENT Book (title?, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value  
<
(BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
ans:a  
4
.Which of the following is TRUE only of XML but NOT HTML?  
a.It is derived from SGML  
b.It describes content and layout  
c.It allows user defined tags  
d.It is restricted only to be used with web browser  
ans:a,c  
5
.Which of the following statements are true with reference to the way of describing XML data?  
(
a)XML uses DTD to describe the data  
b)XML uses XSL to describe the data (c)  
(
XML uses a description node to describe the data Codes:  
a.(a) only  
b.(b) only  
c.(a) and (b)  
d.(a) and (c)  
ans:d  
6
.In XML we can specify the frequency of an element by using the symbols:  
a.+ * !  
b.# * !  
c.+* ?  
d.-*?  
ans:c  
7
.The definitions in an XML document are said to be __________ when the tagging system and  
definitions in the DTD are all in compliance.  
a.well-formed  
b.reasonable  
c.valid  
ans:c  
8
.The behaviour of the document elements in XML can be defined by  
a.Using document object  
b.Registering appropriate event handlers  
c.Using element object  
d.All of the above  
ans:b  
9
. Which is a valid XML comment?  
a.<!It is comment section >  
b.<!It is comment section >  
c.<!It is comment section>  
d.<!It is comment section !>  
ans:b  
1
0.An XML element can contain  
a.text  
b.attributes  
c.other elements  
d. mix of the above  
ans:d  
1
1.In XML, you can indicate an empty element like this:  
a.<element></element>  
b.<element/>  
c.a and b  
d.none  
ans:c  
1
2.XML namespaces avoid element naming conflict.  
a.True b.False  
ans:a  
1
3.What is true about XML Schema?  
a. It is used to describe and validate the structure and the content of XML data.  
b. XML schema defines the elements, attributes and data types.  
c. It is similar to a database schema that describes the data in a database.  
d. All of the above  
ans:d  
1
4.How an element can be defined within an XSD?  
a. <xs:element name = "x" type = "y"/>  
b. <?xs:element name = "x" type = "y"/>  
c. <xs:element name = "x" type = "y">  
d. </xs:element name = "x" type = "y"/>  
ans:a  
1
5._______ element is used only in the context of the text.  
a. Complex Type  
b. Simple type  
c. Global Types  
d. All of the above  
ans:b  
1
6.Which of the following are correct predefined simple types?  
a. xs:integer  
b. xs:char  
c. xs:float  
d. xs:bool  
ans:a  
1
7.Attributes have _______ property.  
a. name  
b. type  
c. Both A and B  
d. None of the above  
ans:c  
1
8.Simple type Built into Schema "data" represent a date in?  
a. MM-DD-YY  
b. DD-MM-YYYY  
c. YY-MM-DD  
d. YYYY-MM-DD  
ans:d  
1
9. XML uses the features of  
a.HTML  
b.XHTML  
c.VML  
d.SGML  
ans:d  
2
0.What are the parsers supported in XML?  
a.non validating and validating  
b.well documented  
c.well formed  
d.none of the above  
ans:a  
2
1.Which of the following strings is a correct XML name?  
a._myElement  
b.my Element  
c.#myElement  
d.None of the above  
ans:a  
2
2.Which of the following are well formed XML fragments?  
a.< myElement myAttribute="someValue’/>  
b.< myElement myAttribute=someValue/>  
c.< myElement myAttribute=’someValue’>  
d.< myElement myAttribute="someValue"/>  
ans:d  
2
3.Any XML must have:-  
a.Closing tag  
b.Root element  
c.Nested child  
d.both a and b  
ans:d  
2
4.How to specify the attributes with multiple values?  
a.< myElement myAttribute="value1" myAttribute="value2"/>  
b.< myElement myAttribute="value1 value2"/>  
c.attributes cannot have multiple values  
d.< myElement myAttribute="value1, value2"/>  
ans:c  
2
5.In terms of performance, which of the following parsers are more suitable?  
a.DOM  
b.SAX  
ans:b  
2
6.Is it easier to process XML than HTML?  
a.No  
b.Yes  
c.Sometimes  
d.Can’t say  
ans:b  
2
7. In XML, what is identified by a URI reference?  
a.XML namespace  
b.XSLT  
c.Schema  
d.DLT  
ans:a  
2
<
8. An element is declared as ANY in the DTD as  
!ELEMENT BODY ANY>. Which are all valid element declaration?  
a.<BODY> sometext</BODY>  
b.<BODY>  
<elements>  
<elements>  
</BODY>  
c.<BODY>  
sometext  
<elements>  
<elements>  
</BODY>  
d.All are valid  
ans:d  
2
<
9.An element is declared as  
!ELEMENT test ( sample +, conclusion )> in DTD. Which element is valid in XML document?  
a.<test>  
<sample>……..</sample>  
<sample>……..</sample>  
<conclusion>…</conclusion>  
</test>  
b.<test>  
<conclusion>…</conclusion>  
</test>  
c.<test>  
<sample>……..</sample>  
<conclusion>…</conclusion>  
</test>  
d.<test>  
<conclusion>…</conclusion>  
<sample>……..</sample>  
</test>  
ans:a,c  
3
<
<
0.What is the meaning of this declaration in DTD?  
!ELEMENT Student ( name, age)>  
!ATTLIST Student no CDATA #REQUIRED >  
a.Student element should have two attributes name and age  
b.Student element should not have any CDATA  
c.Student element should have an attribute no  
d.Student element should have name and age as child elements,attribute no is mandatory  
ans:d  
3
1. Which of the following statements are true?  
a.DOM is event based and SAX is object based  
b.DOM is object based and SAX is event based  
c.Both are object based  
d.Both are event based  
ans:b  
3
1
2
2. Which of the following statemetns are true?  
.org.w3c.dom defines Document class (a DOM) as well as classes for all the components of a DOM  
.org.xml.sax defines the basic SAX APIs.  
3
.javax.xml.parsers is the JAXP APIs, which provide a common interface for different vendors' SAX  
and DOM parsers.  
a.1 and 2  
b.2 and 3  
c.1 and 3  
d. All are true  
ans:d  
3
1
3. State which of the following statements are true.  
.A resource class is a Java class that uses JAX-RS annotations to implement a corresponding Web  
resource.  
2
.Resource classes are POJOs that have at least one method annotated with @Path or a request  
method designator.  
a. 1 is true and 2 is false  
b. 2 is true and 1 is false  
c. Both are true  
d. Both are false  
ans:c  
3
4.Which annotation is used to extract the value of a URI template parameter?  
a.@QueryParam  
b.@FormParam  
c.@PathParam  
d.@HeaderParam  
ans:c  
3
5.Only public methods may be exposed as resource methods.State True/False.  
a.True b. False  
ans:a  
3
6.Conversion between an entity body and a Java type is the responsibility of  
a.Entity  
b.EntityProvider  
c.Resource class  
d.None  
ans:b  
3
1
7.State whether the following statements are true/false.  
.The MessageBodyReader interface defines the contract between the JAX-RS runtime and  
components that provide mapping services from representations to a corresponding Java type.  
2
.The MessageBodyWriter interface defines the contract between the JAX-RS runtime and  
components that provide mapping services from a Java type to a representation.  
a.1 only  
b.2 only  
c.1 and 2 are true  
d.1 and 2 are false  
ans:c  
3
8.What is the status code returned by the server for bad request?  
a.400  
b.401  
c.403  
d.404  
ans:a  
3
9.What is XSRF/CSRF?  
a.Cross Site Response Forgery  
b.Cross Site Request Forgery  
c.Cross Site Rest Forgery  
ans:b  
4
0.Entities can have hyperlinks.  
a. True b.False  
ans:a  
4
1.The URI template for a resource method is given as follows:  
http://example.com/{name1}/{name2}/. What are the valid requests that can be send from client?  
a.http://example.com/jay/gatsby/  
b.http://example.com/jay/  
c.http://example.com/*  
ans:a  
4
2.Which of the following are valid URI templates?  
a.http://example.com/{question}/{question}/{question}/  
b.http://example.com/maps/{location}  
c.http://example.com/{name3}/home/  
d.All are valid  
e.None of the above are valid  
ans:d  
4
3.Which of the following is valid JSON declaration to represent a user with attributes id,name and  
profession?  
a.{  
"
"
"
id":1,  
name":"Mahesh",  
profession":"Teacher"  
}
b.[  
"
id":1,  
"
name":"Mahesh",  
profession":"Teacher"  
"
]
c.{  
id:1,  
name:"Mahesh",  
profession:"Teacher"  
}
d.{  
"
id":"1",  
"
name":"Mahesh",  
profession":"Teacher"  
"
}
ans:a  
4
4.SOAP is not tied to any specific transport protocol.  
a. True b.False  
ans:a  
4
5.XML-RPC is the simplest XML-based protocol for exchanging information between computers.  
a.True b. False  
ans:a  
4
6.You are going to develop Stock market web service which will be consumed by other companies.  
Java team from your company want to re-use your web service code as soon as possible. Which  
approach you will follow in this case?  
A. Top down (contract first)  
B. Meet in the middle  
C. Bottom up (code first)  
D. None of the above  
ans:c  
4
7.Our company want to create application in which servlet will be exposed as WS endpoint. What  
we will require among following? (any 3)  
A. Application needs to be packaged as JAR file.  
B. Application needs to be packaged as WAR file.  
C. web.xml is required.  
D. webservice.xml is required.  
E. WEB-INF directory is required.  
F. META-INF directory is required.  
ans:b c e  
4
8.Please select incorrect statement among following statements.  
a.Confidentiality - encrypting of SOAP messages  
b.Integrity - signing of SOAP messages  
c. Authentication - attach security tokens to SOAP messages  
d. Non-repudiation - signing of SOAP messages  
e. Authorization - attach identity tokens to SOAP message  
ans:e  
4
9.What are three benefits of using SSL to connect to a Web service ? (any 3)  
a. The server is assured of the client's identity if the client issues the certificate.  
b. The client is assured of the server's identity.  
c. Message integrity is preserved between the client and the server.  
d. The communication between the client and the server is still logged.  
e. The communication between the client and the server is encrypted.  
f. Using SSL over HTTP incurs less overhead than HTTPS.  
ans:a c e  
5
0.Which of the following methods are not Idempotent?  
a.Get  
b.Post  
c.Put  
d.Delete  
ans:b  
5
1.Which of these are not the elements WSDL ?  
a.Types  
b.Port Type  
c.Service  
d.destination  
ans:d  
5
2. Which of these test do use an HTTP POST and will send the XML response.  
a.<?xml version="1.0" encoding="utf-8" ?>  
short xmlns="http://tempuri.org/">38</short>  
b.<?xml ?>  
short xmlns="http://tempuri.org/">38</short>  
c.<?xml version="1.0" encoding="utf-8" ?>  
short xmlns="http://tempuri.org/">38  
<
<
<
d.<short xmlns="http://tempuri.org/">38</short>  
ans:a  
5
3.The Web services can not offer the application components like:  
a.currency conversion  
b.weather reports  
c.language translation  
d.web browsers  
ans:d  
5
4.The XML provides the ________ in which you can write the specialized languages to express the  
complex interactions between the clients and the services or between the components of a  
composite service.  
a.language  
b.metalanguage  
c.meta  
d.services  
ans:b  
5
5.Schema is an _____ based alternative for DTD.  
a.XHTML  
b.XSLT  
c.XSL  
d.XML  
ans:d  
5
6.XSLT is:  
a.Extensible Stylesheet Language Translators  
b.Extended Stylesheet Language Transformation  
c.Extensible Stylesheet Language Transformation  
d.Extensible Style Language Transformation  
ans:c  
5
7.What is a web service?  
a.A standard way of integrating web-based applications  
b.One type of service that can be part of a Service Oriented Architecture  
c.Programmable XML-based service  
d.All of the above  
ans: d  
5
8. Service Transport, XML Messaging, Service Description and Service Discovery are four layers of  
a.web service implementing client components  
b.web service protocol stack  
c.web service supporting repository  
d.web service supporting request and response components  
ans:b  
5
9.Web Services attempts to describe architecture based on  
a.Representational State Transfer (REST)  
b.Remote Procedure Calls  
c.Reusable Application Components  
d.None of the above  
ans:a  
6
0.Which of the following is an open source SOAP server and client?  
a.Apache ANT  
b.Apache Tomcat  
c.Jakarta Struts  
d.Apache Axis  
ans:b  
1
._______________ is used to convert your application into Web-Application.  
a. Java Service  
b.Browser Action  
c. Web Services  
d. Struts Services  
ans:-c  
2
.Web Services are _______________.  
a.Application Designing Tool  
b.Application IDE  
c.Application Components  
d.None of these  
ans:-c  
3
.The basic Web Services platform is combination of _____ and _______.  
a.CSS + JAVA  
b.CSS + HTTP  
c.XML + HTTP  
d.XML + HTML  
ans:-c  
4
.Web services communicate using __________.  
a.Open protocols  
b.Open-Close protocols  
c.Close protocols  
d.None of these  
ans:-a  
5
.Web services are self-contained and self-describing.  
a.False b.True  
ans:-b  
6
.Web services can be discovered using ________.  
a.UDDII b.UDDI c.UDII d.UDDDI  
ans:-b  
7
.__________ is the basis for Web services.  
a.PHP  
b.CSS  
c.CGI  
d.XML  
ans:-d  
8
.Which of the following is considered as Web Service Platform Elements ?  
a.SOAP  
b.UDDI  
c.WSDL  
d.All of these  
ans:-d  
9
.WSDL Stands for ______________________.  
a.Web Services Description Language  
b.Web Services Design Language  
c.Web Services Development Language  
d.None of these  
ans:-a  
1
0.UDDI Stands for ______________________.  
a.Universal Development, Design and Integration  
b.Universal Description, Discovery and Integration  
c.Universal Description, Development and Integration  
ans:-b  
1
1.Acronymn of SOAP is ______________.  
a.Simplified Object Arbitary Protocol  
b.Secure Object Access Protocol  
c.Simple Object Access Protocol  
d.None of these  
ans:-c  
1
2.Web-services were developed in order to interact _____________ .  
a.Server  
b.Browsers  
c.Different platforms  
ans:-c  
1
3.Web services use ________ to code and to decode data.  
a.XML  
b.SOAP  
c.UDDI  
d.None of these  
ans:-a  
1
4.Web Services is used to -  
a.Connect existing software  
b.Reuse application-components.  
c.Solve the interoperability problem  
d. All of these  
ans:-d  
1
5.SOAP is an _________ to let applications exchange information over HTTP.  
a.XML-based protocol  
b.JAVA-based protocol  
c.PHP-based protocol  
d.NET-based protocol  
ans:-a  
1
6.SOAP is a _________.  
a.Protocol  
b.Markup  
c.Carrier  
d.Language  
ans:-a  
1
7.SOAP is platform ___________.  
a.Dependent  
b.Independent  
c.None  
ans:-b  
1
8.SOAP is a format for sending messages and is also called as __________.  
a.Data Transfer protocol  
b.Communication protocol  
c.Network protocol  
d.None of these  
ans:-  
1
9.SOAP is a W3C standard ! (True / False)  
a.False b.True  
ans:-b  
2
0._________ is a directory for storing information about web services.  
a.SOAP  
b.CGI  
c.UDDI  
d.HTTP  
ans:-c  
2
1.XML digital signatures provides  
a.Authentication  
b.Authorization  
c.Confidentiality  
d.Integrity  
ans:-c  
2
2.What is RPC?  
a.Remote Process control  
b.Remote Procedure call  
c.Rempte Protocol control  
ans:-b  
2
2.What is SSL?  
a.Secure Socket Layer  
b.Secured Socket Layer  
c.Standard Secured Layer  
d.Standard Socket Layer  
ans:-a  
2
3.Select the communication channel not used in ws  
a.HTTP/POST  
b.MIME  
c.SOAP  
d.HTTP/GET  
ans:-b  
2
4.What is not a part of soap message?  
a.Soap body  
b.Soap envelope  
c.Soap headers  
d.Soap footer  
ans:-d  
2
5.Which of the following component of HTTP response contains metadata for the HTTP Response  
message as key-value pairs?  
a. Status/Response Code  
b. HTTP Version  
c. Response Header  
d. Response Body  
ans:-c  
2
6. Which of the following HTTP method should be read only in nature?  
a.GET  
b.DELETE  
c.POST  
d.PUT  
ans:-a  
2
7. Which of the following directive of Cache Control Header of HTTP response indicates that  
resource is not cachable?  
a.Public  
b.Private  
c.no-cache/no-store  
d.max-age  
ans:-c  
2
8.Which of the following HTTP Status code means NO CONTENT, when response body is empty for  
example, a DELETE request?  
a. 200  
b. 201  
c. 204  
d. 304  
ans:-  
2
9.Which of the following annotation of JAX RS API is used to annotate a method used to  
create/update resource?  
a. @Path  
b. @GET  
c. @PUT  
d.@POST  
ans:-d  
3
0. RESTful web services make use of FTP protocol as a medium of communication between client  
and server.  
a.True b.False  
ans:-b  
3
1.Response Header - Contains metadata for the HTTP Response message as key-value pairs.  
a.True b.False  
ans:-a  
3
2.Which of the following layer in Web Service Protocol Stack is responsible for centralizing services  
into a common registry and providing easy publish/find centralizing services into a common registry  
and providing easy publish/find functionality?  
a.Service Transport  
b.XML Messaging  
c.Service Description  
d.Service Discovery  
ans:-d  
3
3.Annotation which allows the Jaxb2Marshaller marshaller to detect a class’s (i.e., object’s) fields.  
a. XmlRootElement  
b. XmlRoot  
c. NotNull  
d. None of the mentioned  
ans:-a  
3
4.Which of the following is correct about URI in RESTful web services?  
a. Each resource in REST architecture is identified by its URI  
b. Purpose of an URI is to locate a resource(s) on the server hosting the web service  
c. Both of the above  
d. None of the above  
ans:-  
3
5. Annotation added as an input parameter to the handler method  
a. PathParam  
b. Path  
c PathLocale  
d. None of the mentioned  
ans:-d  
3
6. Each resource in REST architecture is identified by its URI.  
a.True b.False  
ans:-a  
3
7. Explain features of XML-RPC?  
a. RPCs are performed using simple XML language  
b. XML encoded Requests are sent via HTTP POST  
c. XML Response is embedded in HTTP response  
d. All of the above  
ans:-d  
3
8.XML tag which represents information related to a REST service’s request.  
a. Result  
b. Title  
c. a&b  
d. None  
ans:-c  
3
9.Some common Resources representations used in REST are  
a.JSON  
b.YAML  
c.XML  
d.HTML  
e. All the above  
ans:-e  
4
0.RESTful web services ?  
a. Defines its own security.  
b. Inherits security measures from the underlying transport.  
c. Both of the above  
d. None of the above  
ans:-b  
4
1.What is/are the advantages of RESTful Web Services.?  
a. Language and Platform independent  
b. REST can use SOAP  
c. Permits different data format  
d. All of the above  
ans:-d  
4
2.Which of the following annotation of JAX RS API states the HTTP Response generated by web  
service?  
a. @DELETE  
b. @HEAD  
c. @Produces  
d. @Consumes  
ans:-c  
4
3. _______________ is the java API for RESTful web services.?  
A. JAX-RS  
B. JAX-WS  
C. Both of the above  
D. None of the above  
ans:-a  
4
4. Select programming languages supported by Web Services  
a. c++  
b. Java  
c. Python  
d. C  
e. All of the above  
ans:-e  
4
5.Which two statements are true about the Web services? (any 2)  
a. SOAP messages are compressed during transport to reduce size of payload.  
b. You have to implement session tracking via HTTP cookies.  
c. The WSDL defines services as collections of network endpoints.  
d. All data shared between Java and non-Java components must be in XML format.  
e. Data interchange is done via in XML.  
ans:-c,e  
4
6.We have a Web Service that can respond with a Street name when receiving a House number.  
This service will be used on several mobile devices and size of payload should be small to consume  
less bandwidth. Which technologies can provide the best solution for this requirement? (any 3)  
a. XML  
b. JSON  
c. JAX-WS  
d. JAX-RS  
e. HTTP  
ans:-b,d,e  
4
7.Given a following code snippet of the service can you tell what is the name of the operation in  
WSDL file?  
@WebService(serviceName = "PayrollSystemService", name = "PayrollSystem", portName =  
"
PayrollSystemPort")  
public class PayrollSystem {  
public String getEmployeeDetails(Long empId) {  
return ""dummyDetails"";  
}
}
a. getEmployeeDetails  
b. getEmployeeDetailsOperation  
c. getEmployeeDetailsMethod  
d. getEmployeeDetailsWebMethod  
e. getEmployeeDetailsService  
ans:-a  
4
8. What is JAXB?  
a.Java API for XML Bean  
b.Java API for XML Binding  
c.Java API for XML Basics  
ans:-b  
4
9.Response entity is defined in which package?  
a.javax.ws.rs.core.Response  
b.javax.ws.rs.Response  
c.javax.ws.Response  
ans:-a  
5
0.Which is the discovery protocol?  
a.SOAP  
b.HTTP  
c.UDDI  
d.WSDL  
ans:-c  
1
.Our company wants to create JAX-WS Web service client for weather forcast service. This weather  
forcast service is implemented in C++. You have given a WSDL file for service. What is correct  
statement to be able to create WS client from WSDL.  
a. Use JAXP to parse and generate the java classes from WSDL. Then create Service Endpoint  
Interface(SEI) from factory classes. Then use SEI to call WS.  
b. Use wsgen to generate SEI from WSDL and then invoke SEI's methods to call WS.  
c. Use wsimport to generate SEI from WSDL and then invoke SEI's methods to call WS.  
d. We can not consume a web service created in C++ on java.  
ans:c  
2
.What is an best way of the handling of application exceptions thrown by a JAX-WS service  
endpoint?  
a. Exceptions should be mapped to faults in WSDL.  
b. Exceptions are NOT handled by JAX-WS clients.  
c. Exceptions are always propagated to JAX-WS clients as RemoteExceptions.  
d. Exceptions are always propagated to JAX-WS clients as WebServiceExceptions.  
e. Exceptions are always propagated to JAX-WS clients as SOAPFaultExceptions.  
ans:a  
3
.What is the correct definition of WSDL's port element?  
a. Contains data type definitions using type system.  
b. Description of an action supported by the service.  
c. Set of operations supported by one or more Endpoints.  
d. A single endpoint defined as a combination of a binding and a network address.  
ans:d  
4
.Which two statements are true about the Web services? (any 2)  
a. SOAP messages are compressed during transport to reduce size of payload.  
b. You have to implement session tracking via HTTP cookies.  
c. The WSDL defines services as collections of network endpoints.  
d. Data interchange is done via XML.  
ans:c,d  
5
.We want to develop a Web Service and after developing we understood result processing can take  
a long time to finish. So we decided to convert it to asynchronous method invocations. Is it possible  
to convert our synchronous Web Service to an asynchronous Web Service using SOAP?  
a. True b.False  
ans:a  
6
.Which of the following code snippet matches to this WSDL portType element?  
portType name="ElementsTableImpl">  
<
<operation name="getTable">  
<
<
<
input message="tns:getTable" />  
output message="tns:getTableResponse" />  
fault message="tns:WsException" name="WsException" />  
</operation>  
</portType>  
a.@WebService  
public class ElementsTableImpl {  
public SimpleElementsTable getElementsTable(Integer number) throws WsException {  
SimpleElementsTable table = new SimpleElementsTable(number);  
return table;  
}
}
b.@WebService  
public class ElementsTableImpl {  
public SimpleElementsTable getTable(Integer number) {  
SimpleElementsTable table = new SimpleElementsTable(number);  
return table;  
}
}
c.@WebService (endpointInterface="ElementsTableService")  
public class ElementsTableImpl {  
public SimpleElementsTable getTable(Integer number) throws WsException {  
SimpleElementsTable table = new SimpleElementsTable(number);  
return table;  
}
}
d.@WebService  
public class ElementsTableImpl {  
public SimpleElementsTable getTable(Integer number) throws WsException {  
SimpleElementsTable table = new SimpleElementsTable(number);  
return table;  
}
}
ans:d  
7
.Select HTTP methods associate with SOAP Web service.  
a. Put  
b. Post  
c. Get  
d. Delete  
ans:b  
8
.Select the operations supported by Web Services.  
a. One way (Request only)  
b. Two way (Request - Response)  
c. Solicit-Response (Server push message and client responds)  
d. Notification (Request/message from server to client)  
e. All of the above  
ans:e  
9
.Select statements which are true for SOAP. (any 3)  
a. SOAP is specification for exchanging structured information  
b. SOAP relies on other transport protocols like http, ftp for data trasmission  
c. SOAP uses xml to format data  
d. SOAP uses json to format data  
ans:a,b,c  
1
0.There are two approaches to develop a web service, depending on whether you define the  
contract first or last.  
a) True  
b) False  
ans:a  
1
1.In contrast, the contract-first approach encourages you to think of the service contract first in  
terms of :-  
a.XML  
b.XML Schema(.xsd)  
c.WSDL  
d.All of the mentioned  
ans:d  
1
2.To send objects across the wire, beans need to be encoded using the Java Architecture for XML  
Binding (JAXB).  
a.True  
b.False  
ans:a  
1
3. If you are deploying into a Java EE 5 (or better) container, you may simply create a bean that is  
annotated with:-  
a. javax.jws.WebService  
b. javax.jws.WebServiceProvider  
c. a&b  
d. none of these  
ans:c  
1
4.Tomcat doesn’t support JAX-WS by itself.  
a.True  
b. False  
ans:a  
1
5. Which of the following role of web service architecture implements the service and makes it  
available on the Internet?  
a. Service Provider  
b. Service Requestor  
c. Service Registry  
d. None of the above  
ans:a  
1
6.The simpler approach of implementing a web service is named as  
a. Entity State Transfer  
b. JavaScript Entity Notation  
c. Representation State Transfer  
d. JavaScript Object Notation  
ans:c  
1
7.Coding and decoding, and transporting the data is performed by  
a. XML and UDDI  
b. XML and SOAP  
c. HTML and HTTP  
d. HTML and SOAP  
ans:b  
1
8.Web Services are  
a.Loosely Coupled  
b.Tightly Coupled  
c.Either Loosely or Tightly Coupled  
d.Neither Loosely nor Tightly Coupled  
ans:a  
1
9.Which of the following is true about Web services?  
a.Web services are open standard (XML, SOAP, HTTP etc.) based Web applications.  
b.Web services interact with other web applications for the purpose of exchanging data.  
c.Web Services can convert your existing applications into Web-applications.  
d.All of the above.  
ans:d  
2
0.Which of the following is correct statement about Synchronicity?  
a.Synchronicity refers to the binding of the client to the execution of the service.  
b.In synchronous invocations, the client blocks and waits for the service to complete its operation  
before continuing.  
c.Asynchronous operations allow a client to invoke a service and then execute other functions.  
d.All of the above  
ans:da  
2
1.How request is sent in XML-RPC?  
a.Requests are encoded in XML and sent via HTTP POST.  
b.Requests are encoded in XML and sent via HTTP GET.  
c.Both of the above.  
d.None of the above.  
ans:  
2
2.Which of the following is a security issue with web services?  
a.Confidentiality  
b.Authentication  
c.Network Security  
d.All of the above  
ans:d  
2
3.URL means ________.  
a.Address of the resource on the web  
b.Term used to describe Website  
c.Term used to get online program  
d.None of these  
ans:a  
2
4. Rest is stateful.  
a.True b.False  
ans:b  
2
5.What is the full form of JSON?  
a.JavaScript Object Native  
b.JavaScript Object Notation  
c.JavaScript Object Negation  
d.Java Object Notation  
ans:b  
2
6. The Service requestor provides a central place where developers can publish new services or find  
existing ones.  
a.True  
b.False  
ans:b  
2
7. Which of the following is correctly defining loosely coupled architecture of web service?  
a. A consumer of a web service is not tied to that web service directly.  
b. The web service interface can change over time without compromising the client's ability to  
interact with the service.  
c.Adopting a loosely coupled architecture tends to make software systems more manageable and  
allows simpler integration between different systems.  
d. All of the above.  
ans:d  
2
8. Which of the following is correct about UDDI?  
a. UDDI is an XML-based standard for describing, publishing, and finding web services.  
b.UDDI is a specification for a distributed registry of web services.  
c.UDDI is platform independent, open framework.  
d. All of the above.  
ans:d  
2
9.Which of the following is true about behavioral characteristics of web services?  
a. Asynchronous clients retrieve their result at a later point in time, while synchronous clients  
receive their result when the service has completed.  
b. A web service supports RPC by providing services of its own, equivalent to those of a traditional  
component, or by translating incoming invocations into an invocation of an EJB or a .NET  
component.  
c.Web services support the transparent exchange of documents to facilitate business integration.  
d.All of the above.  
ans:d  
3
0.Which of the following is correct about XML Messaging layer in Web Service Protocol Stack?  
a.This layer is responsible for encoding messages in a common XML format so that messages can be  
understood at either end.  
b.Currently, this layer includes XML-RPC and SOAP.  
c.Both of the above.  
d.None of the above.  
ans:c  
1
.Which are the main features of XML?  
a. Text data description  
b. Human- and computer-friendly format  
c. Handles data in a tree structure having one-and only one-root element  
d. All mentioned above  
ans:d  
2
.Which is a language for finding information in an XML document?  
a. Xpath  
b. XSLT  
c. XLink  
d. XPointer  
ans:a  
3
.Find the correct syntax of the declaration which defines the XML Version?  
a. < ?xml version= "1.0" ? >  
b. < xml version="1.0"/ >  
c. < ?xml version="1.0" / >  
d. None of the above  
ans:a  
4
.An XML DOM parser converts an XML document into an XML DOM object, which can then be  
manipulated with JavaScript.  
a.True b.False  
ans:a  
5
. Abbreviate the term DOM?  
a. Developed Object Model  
b. Document Object Model  
c. Document Oriented Model  
ans:b  
6
.Which language is case sensitive?  
a. HTML  
b. XML  
c. Both A & B  
d. None of the above  
ans:b  
7
.Which parser is read only?  
a.DOM  
b.SAX  
c.Both  
d.None  
ans:b  
8
.The getElementsByTagName() method is used to retrieve data from an XML document.  
a. True  
b. False  
ans:a  
9
<
<
<
<
. The following example shows which XML Syntax rule,  
note date=" 12/11/2007">  
to>Tove< /to>  
from>Jani< /from>  
/note>  
a. XML Attribute Values Must be Quoted  
b. All XML Elements Must Have a Closing Tag  
c. XML Tags are Case Sensitive  
d. XML Elements Must be Properly Nested  
ans:all the above  
1
0. XML is ?  
a. Platform Independent  
b. Language Independent  
c. Both A & B  
d. None of the above  
ans:c  
1
1. Which are the techniques for defining the structure of a specific type of XML documents?  
a. Schema  
b. DTD  
c. Both A & B  
d. None of the above  
ans:c  
1
2.Which is not a XML function?  
a. Transport information  
b. Style information  
c. Store information  
d. Structure information  
ans:b  
1
<
<
<
<
<
3. Is this a 'well formed' XML document?  
?xml version="1.0"? >  
note >  
to age="29" >John< /to >  
from >Smiley< / from >  
/ note >  
a. True  
b. False  
ans:a  
1
4.Which character in the XML Element will generate an error because the parser interprets it as the  
start of a new element?  
a. " < "  
b. "&"  
c. Both A & B  
d. None of the above  
ans:a  
1
5. Which is not a W3C-recommended specification?  
a. SAX  
b. DOM  
c. Both A & B  
d. None of the above  
ans:a  
1
6. Which internet language is used for describing available web services in XML?  
a. WSDL  
b. RSS  
c. RDF  
d. OWL  
ans:a  
1
7.XML is the most common tool for data transmissions between all sorts of applications  
a. True  
b. False  
ans:a  
1
8. Which is a software- and hardware-independent tool for carrying information?  
a. HTML  
b. XML  
c. Both A & B  
d. None of the above  
ans:b  
1
9.Which Characters are illegal in XML elements?  
a. " < "  
b. "&"  
c. Both A & B  
d. None of the above  
ans:c  
2
0. What is XML used to simplify?  
a. Data storage  
b. Data sharing  
c. Both A & B  
d. None of the above  
ans:c  
2
1.Which are the XML Syntax rules?  
a. All XML Elements Must Have a Closing Tag  
b. XML Tags are not Case Sensitive  
c. XML Elements Must be Properly Nested  
d. Both A & C  
ans:d  
2
2. XML documents must contain a root element; this element is "the parent" of all other elements  
a. True  
b. False  
ans:a  
2
3.XML is designed to store data and _____.  
a. Design  
b. Verify  
c. Transport  
d. Both A & B  
ans: c  
2
4.XML attribute values must always be enclosed in quotes  
a. True  
b. False  
ans:a  
2
5.XML is designed to carry data, and to display data  
a. True  
b. False  
ans:b  
2
6.In XML document comments are given as?  
a. < !-- -->  
b. < !-- ?  
c. < /-- -->  
d. < ?-- ?  
ans:a  
2
7.Which of the following is true about SAX parsing?  
a. SAX parser reads an XML document from top to bottom, recognizing the tokens that make up a  
well-formed XML document.  
b. SAX parser reports the application program the nature of tokens that the parser has encountered  
as they occur  
c. The application program provides an 'event' handler that must be registered with the parser.  
d.All of the above.  
ans:d  
2
8.Which of the following method get called when element ends in SAX parsing?  
a. startDocument()  
b.endDocument()  
c.startElement()  
d. endElement()  
ans:d  
2
9. Which method of JDOM Parser gets the root element of the XML?  
a. Element.getRootElement()  
b. Document.getRootElement()  
c. Node.getRootElement()  
d.Node.getChild(Name)  
ans:b  
3
0.Which technology provides the flexibility to swap between XML processors with no application  
code changes?  
a. JAAS  
b. SAX  
c. XSLT  
d. JAXP  
ans:d  
1
.How to declare element with minimum one occurrence?  
a.<! ELEMENT element-name(element-content+)>  
b.<! ELEMENT element-name(element-content+)!>  
c.<! ELEMENT element-name(element-content)!>  
d.None of the listed options  
ans:a  
2
.Which of the following XML statement is valid?  
a.<message> if price<60</message>  
b.<message> if price lt 60 </message>  
c.<message> if price &lt; 60</message>  
d.None of the listed options  
ans:c  
3
.DTD stands for  
a.Document Type Definition  
b.Direct Type Definition  
c.Dynamic Type Definition  
d.None of these  
ans:a  
4
.Which of the following correctly defines use of DTD in XML development?  
a.DTD are used by parsers for validating the structure of the XML  
b.DTD are used as contract between two systems to interoperate.  
c.An Application can use the DTD to validate the XML structure it has received from external systems  
d.All the above  
ans:d  
5
.Any text that should not be parsed by the xml parser needs to declare as:  
I: PCDATA  
II: CDATA  
a.I  
b.II  
c.Both I and II  
d. None of the above  
ans:b  
6
.What is an XML instance  
a.An XML Document  
b.An XML element  
c.An XML attribute  
ans:a  
7
1
2
3
.What are the uses of XML parsers?  
.Parsing XML files and retrieving data from XML elements  
.Creating XML files programmatically  
.Used to direct conversion using an XSLT processor  
a.1&2  
b.2  
c.1&3  
d.2&3  
ans:a  
8
.Which parser reads small chunk of document at a time,parses it, generate an events and then  
reads another chunk of document?  
a.DOM  
b.SAX  
c.Both  
d.none  
ans:b  
9
.Which defines standard set of objects for creating XML's?  
a.SAX  
b.XML DOM  
c.XML  
d.SAX DOM  
ans:b  
1
0.Which type of parser is suitable,when applications is required to read data without modifying the  
content?  
a.DOM  
b.SAX  
c.Both  
d.None  
ans:b  
1
1.Which statement creates DocumentBuilder instance?  
a.DocumentBuilder b=new DocumentBuilder();  
b.DocumentBuilder b=new Builder();  
c.DocumentBuilder b=factory.new DocumentBuilder();  
d.None  
ans:c  
1
2.What does XSL stands for?  
a.Extensive Style sheet language  
b.Extensible Style Language  
c.Extensible Style Sheet Language  
d.None  
ans:c  
1
3.Which statement creates DocumentBuilderFactory instance?  
a.DocumentBuilderFactory f=new DocumentBuilderFactory();  
b.DocumentBuilderFactory f= BuilderFactory.newInstance();  
c.DocumentBuilderFactory f=DocumentBuilderFactory.newInstance();  
ans:c  
1
4.Which language is used for formatting XML documents?  
a.XSL  
b.XSLT  
c.XSL-FO  
ans:c  
1
5.Which is used to transform XML document?  
a.Xpath  
b.XSLT  
c.XML  
d.XSL  
ans:b  
1
1
2
3
6.What are the two common exceptions in JAXP?  
.ParserConfigurationException  
.FactoryConfigurationException  
.FactoryConfigurationError  
a.1&2  
b.3  
c.1&3  
d.1  
ans:c  
1
7.JAXP Stands for  
a.Java API eXtensive processing  
b.Java API eXtensible Processing  
c.Java API for XML Processing  
d.Java API for XML Parsing  
ans:c  
1
8.In which package JAXP related API's are available?  
a.javax.xml.parsers.*;  
b.javax.xml.*;  
c.javax.parsers.xml.*;  
ans:a  
1
9.Which complex type specifies that the elements should always be in the order specified?  
a.<xs:complexType name="CountrInfo">  
<xs:all>  
<xs:element name="countryName" type="xs:string"/>  
<xs:element name="states" type="xs:integer"/></xs:all>  
</xs:complexType>  
b.<xs:complexType name="CountrInfo"><xs:choice> <xs:element name="countryName"  
type="xs:string"/>  
<
xs:element name="states" type="xs:integer"/></xs:choice>  
/xs:complexType>  
c.<xs:complexType name="CountrInfo">  
<
<xs:sequence> <xs:element name="countryName" type="xs:string"/>  
<xs:element name="states" type="xs:integer"/>  
</xs:sequence></xs:complexType>  
ans:c  
2
0.Which statement specifies a constant value for a simple element?  
a.<xs:element name="CountryName" type="xs:string" constant="India"/>  
b.<xs:element name="CountryName" type="xs:string" fixed="India"/>  
c.<xs:element name="CountryName" type="xs:string" fixedvalue="India"/>  
ans:b  
2
1.Which complex type signifies that only one of the child elements can appear?  
a.<xs:complexType name="CountrInfo">  
<xs:all>  
<xs:element name="countryName" type="xs:string"/> <xs:element name="states"  
type="xs:integer"/></xs:all>  
/xs:complexType>  
b.<xs:complexType name="CountrInfo">  
<
<
<
<
<
xs:choice>  
xs:element name="countryName" type="xs:string"/>  
xs:element name="states" type="xs:integer"/>  
/xs:choice></xs:complexType>  
c.<xs:complexType name="CountrInfo">  
<
xs:sequence> <xs:element name="countryName" type="xs:string"/>  
xs:element name="states" type="xs:integer"/></xs:sequence></xs:complexType>  
ans:b  
<
2
2.Which method of DocumentBuilder is used to parse the xml file?  
a.parse  
b.read  
c.parseXML  
ans:a  
2
3.In XML DOM every XML element is treated as Node.  
a.True b.False  
ans:a  
2
4.Which method is used to get the element type of a XML document?  
a.node.getNodeType()  
b.node.getElementType()  
c.node.getType()  
ans:a  
2
5.Which statement is true?  
a.All XML elements must be lower case  
b.All XML documents must have a DTD  
c.All XML elements must be properly closed  
d.All the statements are true  
ans:c  
2
6.Which statement is NOT true?  
a.White-space is not preserved in XML  
b.XML documents must have a root tag  
c.XML tags are case sensitive  
d.XML elements must be properly nested  
ans:a  
2
7.XML elements cannot be empty  
a.False b.True  
ans:a  
2
8.Which is not a correct name for an XML element?  
a.<1dollar>  
b.<h1>  
c.<Note>  
d.All 3 names are incorrect  
ans:a  
2
8.For the XML parser to ignore a certain section of your XML document, which syntax is correct?  
a.![CDATA[ Text to be ignored ]]>  
b.<CDATA> Text to be ignored </CDATA>  
c.<xml:CDATA[ Text to be ignored ]>  
d.<PCDATA> Text to be ignored </PCDATA>  
ans:a  
2
9.What are XML entities used for?  
a.Entities define shortcuts to standard text or special characters bEntities define shortcuts to  
standard elements  
c.Entities define shortcuts to standard attributes  
ans:a  
3
0. Which XML DOM object represents a node in the node tree?  
a.The node object  
b.The nodeList object  
c.The document object  
ans:a  
1
1
2
3
4
.Which of following statements is/are False?  
. XML overcomes the limitations in HTML to support a structured way of organizing content.  
. XML specification is not case sensitive while HTML specification is case sensitive.  
. XML supports user defined tags while HTML uses pre-defined tags.  
. XML tags need not be closed while HTML tags must be closed.  
a.2 only  
b.1 only  
c.2 and 4  
d.3 and 4  
ans:c  
2
.Consider an XML file called intro.xml and a document type defintion (DTD) file intro.dtd as follows:  
intro.xml  
<
<
<
<
<
?xml version = "1.0"?>  
!DOCTYPE myMessage SYSTEM "intro.dtd"›  
myMessage>  
message>Welcome to XML</message>  
/myMessage>  
intro.dtd  
<
! ELEMENT myMessage (message)>  
! ELEMENT message (#PCDATA)>  
<
A validating parser will classify intro.xml as  
a.Well-formed and validated  
b.Well-formed but not validated  
c.Validated but not well-formed  
ans:a  
3
.Given below is an excerpt of an xml specification.  
Book>  
<
<
<
<
<
<
<
<
<
title> GATE 2005 </title>  
type value = "BROCHURE"/>  
accno>10237623786</accno>  
/Book>  
Book>  
type value = "FICTION"/>  
accno>0024154807</accno>  
/Book>  
Given below are several possible excerpts from "library.dtd". For which excerpt would the above  
specification be valid?  
a.<!ELEMENT Book (title+, type, accno)>  
<
!ELEMENT title (#PCDATA)>  
!ELEMENT type EMPTY>  
<
<!ATTLIST type value (BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
b.  
<
!ELEMENT Book (title?, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value  
<
(BROCHURE/FICTION/TECHNICAL)> <!ATTLIST accno value (#PCDATA)>  
c.  
<
!ELEMENT Book (title*, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type ATTLIST> <!ATTLIST type value  
<
(BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
d.  
<
!ELEMENT Book (title?, type, accno)>  
!ELEMENT title (#PCDATA)> <!ELEMENT type EMPTY> <!ATTLIST type value  
<
(BROCHURE/FICTION/TECHNICAL)> <!ELEMENT accno (#PCDATA)>  
ans:a  
4
.Which of the following is TRUE only of XML but NOT HTML?  
a.It is derived from SGML  
b.It describes content and layout  
c.It allows user defined tags  
d.It is restricted only to be used with web browser  
ans:a,c  
5
.Which of the following statements are true with reference to the way of describing XML data?  
(
a)XML uses DTD to describe the data  
b)XML uses XSL to describe the data (c)  
(
XML uses a description node to describe the data Codes:  
a.(a) only  
b.(b) only  
c.(a) and (b)  
d.(a) and (c)  
ans:d  
6
.In XML we can specify the frequency of an element by using the symbols:  
a.+ * !  
b.# * !  
c.+* ?  
d.-*?  
ans:c  
7
.The definitions in an XML document are said to be __________ when the tagging system and  
definitions in the DTD are all in compliance.  
a.well-formed  
b.reasonable  
c.valid  
ans:c  
8
.The behaviour of the document elements in XML can be defined by  
a.Using document object  
b.Registering appropriate event handlers  
c.Using element object  
d.All of the above  
ans:b  
9
. Which is a valid XML comment?  
a.<!It is comment section >  
b.<!It is comment section >  
c.<!It is comment section>  
d.<!It is comment section !>  
ans:b  
1
0.An XML element can contain  
a.text  
b.attributes  
c.other elements  
d. mix of the above  
ans:d  
1
1.In XML, you can indicate an empty element like this:  
a.<element></element>  
b.<element/>  
c.a and b  
d.none  
ans:c  
1
2.XML namespaces avoid element naming conflict.  
a.True b.False  
ans:a  
1
3.What is true about XML Schema?  
a. It is used to describe and validate the structure and the content of XML data.  
b. XML schema defines the elements, attributes and data types.  
c. It is similar to a database schema that describes the data in a database.  
d. All of the above  
ans:d  
1
4.How an element can be defined within an XSD?  
a. <xs:element name = "x" type = "y"/>  
b. <?xs:element name = "x" type = "y"/>  
c. <xs:element name = "x" type = "y">  
d. </xs:element name = "x" type = "y"/>  
ans:a  
1
5._______ element is used only in the context of the text.  
a. Complex Type  
b. Simple type  
c. Global Types  
d. All of the above  
ans:b  
1
6.Which of the following are correct predefined simple types?  
a. xs:integer  
b. xs:char  
c. xs:float  
d. xs:bool  
ans:a  
1
7.Attributes have _______ property.  
a. name  
b. type  
c. Both A and B  
d. None of the above  
ans:c  
1
8.Simple type Built into Schema "data" represent a date in?  
a. MM-DD-YY  
b. DD-MM-YYYY  
c. YY-MM-DD  
d. YYYY-MM-DD  
ans:d  
1
9. XML uses the features of  
a.HTML  
b.XHTML  
c.VML  
d.SGML  
ans:d  
2
0.What are the parsers supported in XML?  
a.non validating and validating  
b.well documented  
c.well formed  
d.none of the above  
ans:a  
2
1.Which of the following strings is a correct XML name?  
a._myElement  
b.my Element  
c.#myElement  
d.None of the above  
ans:a  
2
2.Which of the following are well formed XML fragments?  
a.< myElement myAttribute="someValue’/>  
b.< myElement myAttribute=someValue/>  
c.< myElement myAttribute=’someValue’>  
d.< myElement myAttribute="someValue"/>  
ans:d  
2
3.Any XML must have:-  
a.Closing tag  
b.Root element  
c.Nested child  
d.both a and b  
ans:d  
2
4.How to specify the attributes with multiple values?  
a.< myElement myAttribute="value1" myAttribute="value2"/>  
b.< myElement myAttribute="value1 value2"/>  
c.attributes cannot have multiple values  
d.< myElement myAttribute="value1, value2"/>  
ans:c  
2
5.In terms of performance, which of the following parsers are more suitable?  
a.DOM  
b.SAX  
ans:b  
2
6.Is it easier to process XML than HTML?  
a.No  
b.Yes  
c.Sometimes  
d.Can’t say  
ans:b  
2
7. In XML, what is identified by a URI reference?  
a.XML namespace  
b.XSLT  
c.Schema  
d.DLT  
ans:a  
2
<
8. An element is declared as ANY in the DTD as  
!ELEMENT BODY ANY>. Which are all valid element declaration?  
a.<BODY> sometext</BODY>  
b.<BODY>  
<elements>  
<elements>  
</BODY>  
c.<BODY>  
sometext  
<elements>  
<elements>  
</BODY>  
d.All are valid  
ans:d  
2
<
9.An element is declared as  
!ELEMENT test ( sample +, conclusion )> in DTD. Which element is valid in XML document?  
a.<test>  
<sample>……..</sample>  
<sample>……..</sample>  
<conclusion>…</conclusion>  
</test>  
b.<test>  
<conclusion>…</conclusion>  
</test>  
c.<test>  
<sample>……..</sample>  
<conclusion>…</conclusion>  
</test>  
d.<test>  
<conclusion>…</conclusion>  
<sample>……..</sample>  
</test>  
ans:a,c  
3
<
<
0.What is the meaning of this declaration in DTD?  
!ELEMENT Student ( name, age)>  
!ATTLIST Student no CDATA #REQUIRED >  
a.Student element should have two attributes name and age  
b.Student element should not have any CDATA  
c.Student element should have an attribute no  
d.Student element should have name and age as child elements,attribute no is mandatory  
ans:d  
3
1. Which of the following statements are true?  
a.DOM is event based and SAX is object based  
b.DOM is object based and SAX is event based  
c.Both are object based  
d.Both are event based  
ans:b  
3
1
2
2. Which of the following statemetns are true?  
.org.w3c.dom defines Document class (a DOM) as well as classes for all the components of a DOM  
.org.xml.sax defines the basic SAX APIs.  
3
.javax.xml.parsers is the JAXP APIs, which provide a common interface for different vendors' SAX  
and DOM parsers.  
a.1 and 2  
b.2 and 3  
c.1 and 3  
d. All are true  
ans:d  
3
1
3. State which of the following statements are true.  
.A resource class is a Java class that uses JAX-RS annotations to implement a corresponding Web  
resource.  
2
.Resource classes are POJOs that have at least one method annotated with @Path or a request  
method designator.  
a. 1 is true and 2 is false  
b. 2 is true and 1 is false  
c. Both are true  
d. Both are false  
ans:c  
3
4.Which annotation is used to extract the value of a URI template parameter?  
a.@QueryParam  
b.@FormParam  
c.@PathParam  
d.@HeaderParam  
ans:c  
3
5.Only public methods may be exposed as resource methods.State True/False.  
a.True b. False  
ans:a  
3
6.Conversion between an entity body and a Java type is the responsibility of  
a.Entity  
b.EntityProvider  
c.Resource class  
d.None  
ans:b  
3
1
7.State whether the following statements are true/false.  
.The MessageBodyReader interface defines the contract between the JAX-RS runtime and  
components that provide mapping services from representations to a corresponding Java type.  
2
.The MessageBodyWriter interface defines the contract between the JAX-RS runtime and  
components that provide mapping services from a Java type to a representation.  
a.1 only  
b.2 only  
c.1 and 2 are true  
d.1 and 2 are false  
ans:c  
3
8.What is the status code returned by the server for bad request?  
a.400  
b.401  
c.403  
d.404  
ans:a  
3
9.What is XSRF/CSRF?  
a.Cross Site Response Forgery  
b.Cross Site Request Forgery  
c.Cross Site Rest Forgery  
ans:b  
4
0.Entities can have hyperlinks.  
a. True b.False  
ans:a  
4
1.The URI template for a resource method is given as follows:  
http://example.com/{name1}/{name2}/. What are the valid requests that can be send from client?  
a.http://example.com/jay/gatsby/  
b.http://example.com/jay/  
c.http://example.com/*  
ans:a  
4
2.Which of the following are valid URI templates?  
a.http://example.com/{question}/{question}/{question}/  
b.http://example.com/maps/{location}  
c.http://example.com/{name3}/home/  
d.All are valid  
e.None of the above are valid  
ans:d  
4
3.Which of the following is valid JSON declaration to represent a user with attributes id,name and  
profession?  
a.{  
"
"
"
id":1,  
name":"Mahesh",  
profession":"Teacher"  
}
b.[  
"
id":1,  
"
name":"Mahesh",  
profession":"Teacher"  
"
]
c.{  
id:1,  
name:"Mahesh",  
profession:"Teacher"  
}
d.{  
"
id":"1",  
"
name":"Mahesh",  
profession":"Teacher"  
"
}
ans:a  
4
4.SOAP is not tied to any specific transport protocol.  
a. True b.False  
ans:a  
4
5.XML-RPC is the simplest XML-based protocol for exchanging information between computers.  
a.True b. False  
ans:a  
4
6.You are going to develop Stock market web service which will be consumed by other companies.  
Java team from your company want to re-use your web service code as soon as possible. Which  
approach you will follow in this case?  
A. Top down (contract first)  
B. Meet in the middle  
C. Bottom up (code first)  
D. None of the above  
ans:c  
4
7.Our company want to create application in which servlet will be exposed as WS endpoint. What  
we will require among following? (any 3)  
A. Application needs to be packaged as JAR file.  
B. Application needs to be packaged as WAR file.  
C. web.xml is required.  
D. webservice.xml is required.  
E. WEB-INF directory is required.  
F. META-INF directory is required.  
ans:b c e  
4
8.Please select incorrect statement among following statements.  
a.Confidentiality - encrypting of SOAP messages  
b.Integrity - signing of SOAP messages  
c. Authentication - attach security tokens to SOAP messages  
d. Non-repudiation - signing of SOAP messages  
e. Authorization - attach identity tokens to SOAP message  
ans:e  
4
9.What are three benefits of using SSL to connect to a Web service ? (any 3)  
a. The server is assured of the client's identity if the client issues the certificate.  
b. The client is assured of the server's identity.  
c. Message integrity is preserved between the client and the server.  
d. The communication between the client and the server is still logged.  
e. The communication between the client and the server is encrypted.  
f. Using SSL over HTTP incurs less overhead than HTTPS.  
ans:a c e  
5
0.Which of the following methods are not Idempotent?  
a.Get  
b.Post  
c.Put  
d.Delete  
ans:b  
5
1.Which of these are not the elements WSDL ?  
a.Types  
b.Port Type  
c.Service  
d.destination  
ans:d  
5
2. Which of these test do use an HTTP POST and will send the XML response.  
a.<?xml version="1.0" encoding="utf-8" ?>  
short xmlns="http://tempuri.org/">38</short>  
b.<?xml ?>  
short xmlns="http://tempuri.org/">38</short>  
c.<?xml version="1.0" encoding="utf-8" ?>  
short xmlns="http://tempuri.org/">38  
<
<
<
d.<short xmlns="http://tempuri.org/">38</short>  
ans:a  
5
3.The Web services can not offer the application components like:  
a.currency conversion  
b.weather reports  
c.language translation  
d.web browsers  
ans:d  
5
4.The XML provides the ________ in which you can write the specialized languages to express the  
complex interactions between the clients and the services or between the components of a  
composite service.  
a.language  
b.metalanguage  
c.meta  
d.services  
ans:b  
5
5.Schema is an _____ based alternative for DTD.  
a.XHTML